//春游
import java.util.;

public class Main{
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        while(t--  0) {
            long n = in.nextLong();
            long a = in.nextLong();
            long b = in.nextLong();
            long money = 0;
            if (n = 2) {
                System.out.println(a  b  a  b);
                continue;
            }
            if ((3a) = (2b)) {
                双人
                money = (n2)a;
                if (n % 2 == 1) {
                    money = Math.min(money+a, Math.min(money+b, money-a+b));
                }
            } else {
                三人
                money = (n3)b;
                if (n % 3 == 1) {
                    money = Math.min(money+a, Math.min(money+b, money-b+a+a));
                } else if (n % 3 == 2) {
                    money = Math.min(money+a, Math.min(money+b, money-b+a+a+a));
                }
            }
            
            System.out.println(money);
        }
    }
}